import {connect} from 'react-redux'
import Cate from '.'

export default connect(
    (state)=>{ //负责将store中state数据以属性的形式写入到组件props中
        return {
            c: state.count,
            ld: state.loginData
        }
    },
    (dispatch)=>{ //负责将方法以属性的形式写入到组件props中
        return { 
            add(){
                dispatch( { type:'ADD_COUNT',payload:1 } );
            },
            sub(){
                dispatch( { type:'SUB_COUNT',payload:1 } );
            },
        }
    }
)(Cate)